home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
fido
/
fz104.lha
/
rexx
/
SetKeep.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-06-01
|
1KB
|
51 lines
/*
*
* Set Keep Value for all Areas
*
*
* Usage: rx SetKeep <infile> <outfile>
*
* e.g. rx SetKeep fido:Foozle.areas ram:Foozle.areas
*
*/
keepval = 10 /* number of days/msgs to keep */
keepdays = "10"x /* set to "00"x for keeping messages by number */
parse arg infile outfile
if ~open(in, infile, R) then do
say "Couldn't open" infile "!"
exit 20
end
if ~open(out, compress(outfile), W) then do
say "Couldn't open" outfile "!"
call close in
exit 20
end
do forever
area = readch(in, 728)
if length(area) < 728 then leave
else if left(area, 1) ~= "00"x then do
area = overlay(right("00"x || d2c(keepval), 2), area, 205) /* use 207 to adjust preserve value */
area = overlay(bitor(bitand(substr(area, 202, 1), "EF"x), keepdays), area, 202)
end
else leave
call writech out, area
end
call writech out, area
do forever
area = readch(in, 1000)
call writech out, area
if length(area) < 1000 then leave
end
call close out
call close in
exit